#include <bits/stdc++.h>

using namespace std;

int a[10],sum,ji=1;
int main()
{
    for(int i=123;i<=329;i++){
        sum=0;
        ji=1;
        a[1] = i/100;
        a[2] = i/10%10;
        a[3] = i%10;
        a[4] = 2*i/100;
        a[5] = 2*i/10%10;
        a[6] = 2*i%10;
        a[7] = 3*i/100;
        a[8] = 3*i/10%10;
        a[9] = 3*i%10;
        for(int j=1;j<=9;j++){
            sum+=a[j];
            ji*=a[j];
        }
        if(sum==45&&ji==362880){
            cout<<i<<' '<<2*i<<' '<<3*i<<endl;
        }
    }
    return 0;
}
